﻿using SqlSugar;
using System;
using System.Collections.Generic;
using System.Linq;
using System.Security.Principal;
using System.Text;
using System.Threading.Tasks;

namespace FastCodeGeneration.Entity
{

    [SugarTable("sys_module")]//当和数据库名称不一样可以设置表别名 指定表明
    public class Module
    {
        /// <summary>
        /// 主键
        /// </summary>
        [SugarColumn(ColumnName = "id", IsPrimaryKey = true, IsIdentity = true)]//数据库是自增才配自增 
        public int? Id { get; set; }

        /// <summary>
        /// 项目id
        /// </summary>
        [SugarColumn(ColumnName = "project_id")]
        public int ProjectId { set; get; }

        /// <summary>
        /// 模块名
        /// </summary>
        [SugarColumn(ColumnName = "name")]
        public string Name { get; set; } = string.Empty;

        /// <summary>
        /// 表前缀
        /// </summary>
        [SugarColumn(ColumnName = "table_prefix")]
        public string TablePrefix { get; set; } = string.Empty;

        /// <summary>
        /// 模块目录
        /// </summary>
        [SugarColumn(ColumnName = "module_path")]
        public string ModulePath { get; set; } = string.Empty;

        /// <summary>
        /// 生成的文件是否忽略表前缀
        /// </summary>
        [SugarColumn(ColumnName = "file_ignore_prefix")]
        public bool FileIgnorePrefix { get; set; } = true;

        /// <summary>
        /// domain_folder
        /// </summary>
        [SugarColumn(ColumnName = "domain_folder")]
        public string DomainFolder { get; set; } = string.Empty;

        /// <summary>
        /// mapper_folder
        /// </summary>
        [SugarColumn(ColumnName = "mapper_folder")]
        public string MapperFolder { get; set; } = string.Empty;

        /// <summary>
        /// service_folder
        /// </summary>
        [SugarColumn(ColumnName = "service_folder")]
        public string ServiceFolder { get; set; } = string.Empty;

        /// <summary>
        /// controller_folder
        /// </summary>
        [SugarColumn(ColumnName = "controller_folder")]
        public string ControllerFolder { get; set; } = string.Empty;


        /// <summary>
        /// 项目名
        /// </summary>
        [SugarColumn(IsIgnore = true)]
        public string ProjectName { set; get; } = string.Empty;
    }
}
